package com.electronic.modules.verify;


import com.cebpubservice.cashare.sdk.electronicsealsignatureandverifysignature.GetCAOrgCertChainInfo;
import com.cebpubservice.cashare.sdk.electronicsealsignatureandverifysignature.param.BatchGetCAOrgCertChainInfoParamDTO;
import com.cebpubservice.cashare.sdk.electronicsealsignatureandverifysignature.result.BatchGetCAOrgCertChainInfoResultDTO;
import com.electronic.api.R;
import com.electronic.domain.CebsConfiguration;
import com.electronic.domain.CebsSdkProperties;

import java.util.List;


/**
 * 证书链服务
 * @author zyh 
 * ================================
 * Date: 2024/7/31
 * Time: 下午2:49
 * ================================
 */
public class CertChainService {
    /**
     * 获取证书链
     * @param cebsSdkProperties sdk初始话信息
     * @return
     */
    public static R<List<BatchGetCAOrgCertChainInfoResultDTO>> getCertChain(CebsSdkProperties cebsSdkProperties) {

        //初始化SDK
        CebsConfiguration.init(cebsSdkProperties);
        //构造参数
        BatchGetCAOrgCertChainInfoParamDTO queryCAOrgCertChainInfoParamDTO = new BatchGetCAOrgCertChainInfoParamDTO();
        //获取全部证书链
        List<BatchGetCAOrgCertChainInfoResultDTO> batchGetCAOrgCertChainInfoResultDTOS = GetCAOrgCertChainInfo.batchGetCAOrgCertChainInfo(queryCAOrgCertChainInfoParamDTO);
        //返回证书链信息
        return R.data(batchGetCAOrgCertChainInfoResultDTOS);
    }


}